<script setup>
import { onMounted, ref, watchEffect } from "vue";
import Dialog from "@/components/Dialog.vue";
import * as echarts from "echarts";
import { sat } from "@/api/index.js";
const showData = ref({
  hourValueList: [
    820, 932, 901, 934, 932, 1290, 1330, 1320, 820, 932, 901, 1290, 1330, 1320,
    820, 932, 901, 934, 1290, 1330, 1320, 820, 932, 901, 934, 1290, 1330, 1320,
    820, 932, 901, 934, 1290, 1330, 1320, 820, 932, 901, 934, 1290, 1330, 1320,
    932, 901, 934,
  ],
  todayValueList: [
    330, 320, 82, 82, 93, 90, 34, 129, 330, 320, 82, 93, 90, 34, 129, 330, 320,
    82, 93, 90, 34, 129, 330, 320, 82, 93, 90, 34, 129, 330, 320, 82, 93, 90,
    34, 129, 330, 320, 82, 93, 90, 34, 129, 330, 320,
  ],
  totalValueList: [
    24309523, 24309523, 24309523, 24309523, 24309523, 24309523, 24309523,
    24309523, 24309523, 24309523, 24309523, 24309523, 24309523, 24309523,
    24309523, 24309523, 24309523, 24309523, 24309523, 24309523, 24309523,
    24309523, 24309523, 24309523, 24309523, 24309523, 24309523, 24309523,
    24309523, 24309523, 24309523, 24309523, 24309523, 24309523, 24309523,
    24309523, 24309523, 24309523, 24309523, 24309523, 24309523, 24309523,
    24309523, 24309523, 24309523, 24309523,
  ],
});
const props = defineProps(["visible", "title", "thead", "data", "item1T_num"]);

const init = () => {
  let aa = [
    {
      name: "凌晨时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "00:00:00",
      timeStr: "00:00",
    },
    {
      name: "凌晨时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "00:30:00",
      timeStr: "00:30",
    },
    {
      name: "凌晨时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "01:00:00",
      timeStr: "01:00",
    },
    {
      name: "凌晨时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "01:30:00",
      timeStr: "01:30",
    },
    {
      name: "凌晨时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "02:00:00",
      timeStr: "02:00",
    },
    {
      name: "凌晨时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "02:30:00",
      timeStr: "02:30",
    },
    {
      name: "凌晨时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "03:00:00",
      timeStr: "03:00",
    },
    {
      name: "凌晨时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "03:30:00",
      timeStr: "03:30",
    },
    {
      name: "凌晨时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "04:00:00",
      timeStr: "04:00",
    },
    {
      name: "凌晨时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "04:30:00",
      timeStr: "04:30",
    },
    {
      name: "凌晨时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "05:00:00",
      timeStr: "05:00",
    },
    {
      name: "凌晨时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "05:30:00",
      timeStr: "05:30",
    },
    {
      name: "上午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "06:00:00",
      timeStr: "06:00",
    },
    {
      name: "上午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "06:30:00",
      timeStr: "06:30",
    },
    {
      name: "上午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "07:00:00",
      timeStr: "07:00",
    },
    {
      name: "上午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "07:30:00",
      timeStr: "07:30",
    },
    {
      name: "上午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "08:00:00",
      timeStr: "08:00",
    },
    {
      name: "上午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "08:30:00",
      timeStr: "08:30",
    },
    {
      name: "上午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "09:00:00",
      timeStr: "09:00",
    },
    {
      name: "上午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "09:30:00",
      timeStr: "09:30",
    },
    {
      name: "上午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "10:00:00",
      timeStr: "10:00",
    },
    {
      name: "上午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "10:30:00",
      timeStr: "10:30",
    },
    {
      name: "上午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "11:00:00",
      timeStr: "11:00",
    },
    {
      name: "上午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "11:30:00",
      timeStr: "11:30",
    },
    {
      name: "下午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "12:00:00",
      timeStr: "12:00",
    },
    {
      name: "下午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "12:30:00",
      timeStr: "12:30",
    },
    {
      name: "下午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "13:00:00",
      timeStr: "13:00",
    },
    {
      name: "下午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "13:30:00",
      timeStr: "13:30",
    },
    {
      name: "下午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "14:00:00",
      timeStr: "14:00",
    },
    {
      name: "下午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "14:30:00",
      timeStr: "14:30",
    },
    {
      name: "下午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "15:00:00",
      timeStr: "15:00",
    },
    {
      name: "下午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "15:30:00",
      timeStr: "15:30",
    },
    {
      name: "下午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "16:00:00",
      timeStr: "16:00",
    },
    {
      name: "下午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "16:30:00",
      timeStr: "16:30",
    },
    {
      name: "下午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "17:00:00",
      timeStr: "17:00",
    },
    {
      name: "下午时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "17:30:00",
      timeStr: "17:30",
    },
    {
      name: null,
      todayValue: 0,
      totalValue: 0,
      hourValue: 0,
      time: "18:00:00",
      timeStr: "18:00",
    },
    {
      name: null,
      todayValue: 0,
      totalValue: 0,
      hourValue: 0,
      time: "18:30:00",
      timeStr: "18:30",
    },
    {
      name: null,
      todayValue: 0,
      totalValue: 0,
      hourValue: 0,
      time: "19:00:00",
      timeStr: "19:00",
    },
    {
      name: null,
      todayValue: 0,
      totalValue: 0,
      hourValue: 0,
      time: "19:30:00",
      timeStr: "19:30",
    },
    {
      name: null,
      todayValue: 0,
      totalValue: 0,
      hourValue: 0,
      time: "20:00:00",
      timeStr: "20:00",
    },
    {
      name: null,
      todayValue: 0,
      totalValue: 0,
      hourValue: 0,
      time: "20:30:00",
      timeStr: "20:30",
    },
    {
      name: null,
      todayValue: 0,
      totalValue: 0,
      hourValue: 0,
      time: "21:00:00",
      timeStr: "21:00",
    },
    {
      name: null,
      todayValue: 0,
      totalValue: 0,
      hourValue: 0,
      time: "21:30:00",
      timeStr: "21:30",
    },
    {
      name: null,
      todayValue: 0,
      totalValue: 0,
      hourValue: 0,
      time: "22:00:00",
      timeStr: "22:00",
    },
    {
      name: null,
      todayValue: 0,
      totalValue: 0,
      hourValue: 0,
      time: "22:30:00",
      timeStr: "22:30",
    },
    {
      name: null,
      todayValue: 0,
      totalValue: 0,
      hourValue: 0,
      time: "23:00:00",
      timeStr: "23:00",
    },
    {
      name: "晚上时段",
      todayValue: 0,
      totalValue: 24309536,
      hourValue: 0,
      time: "23:30:00",
      timeStr: "23:30",
    },
  ];
  let hourValueList = [];
  let todayValueList = [];
  let totalValueList = [];
  aa.forEach((v) => {
    hourValueList.push(v.hourValue);
    todayValueList.push(v.todayValue);
    totalValueList.push(v.totalValue);
  });
  const option = {
    grid: {
      left: "4%",
      right: "18%",
      bottom: "20%",
      top: "10%",
      containLabel: true,
    },
    tooltip: {
      trigger: "axis",
      // axisPointer: {
      //   type: "cross",
      //   crossStyle: {
      //     color: "#999",
      //   },
      // },
    },
    legend: {
      data: ["前半个小时当日访问量(次)", "当日访问量(次)", "总访问量(次)"],
      selectedMode: "single",
      itemWidth: 20,
      itemHeight: 14,
      right: "20%",
      textStyle: {
        //图例中文字的样式
        color: "#ffffff",
        fontSize: 11,
      },
    },
    xAxis: {
      type: "category",
      data: [
        "0:00",
        "1:00",
        "1:30",
        "2:00",
        "2:30",
        "3:00",
        "3:30",
        "4:00",
        "4:30",
        "5:00",
        "5:30",
        "6:00",
        "6:30",
        "7:00",
        "7:30",
        "8:30",
        "9:00",
        "9:30",
        "10:00",
        "10:30",
        "11:30",
        "12:00",
        "12:30",
        "13:00",
        "13:30",
        "14:00",
        "14:30",
        "15:00",
        "15:30",
        "16:00",
        "16:30",
        "17:00",
        "17:30",
        "18:00",
        "18:30",
        "19:00",
        "19:30",
        "20:00",
        "20:30",
        "21:00",
        "21:30",
        "22:00",
        "22:30",
        "23:00",
        "23:30",
      ],
      axisTick: {
        alignWithLabel: true,
      },
      axisLine: {
        //坐标轴轴线相关设置。数学上的x轴
        show: false,
        lineStyle: {
          color: "#fff",
        },
      },
      axisLabel: {
        show: true,
        //坐标轴刻度标签的相关设置
        textStyle: {
          color: "rgba(118, 118, 169, 1)",
          fontSize: 12,
        },
        // interval: 0,
        // formatter: function (params) {
        //   return params;
        // },
      },
      splitLine: {
        show: true,
        lineStyle: {
          color: "#0b4f75",
          type: "dashed", // 线型为虚线
        },
      },
      axisTick: {
        show: false,
      },
    },
    yAxis: {
      type: "value",
      nameLocation: "end",
      nameTextStyle: {
        color: "#C9E9F8",
      },
      //   interval: 50,
      //   axisLabel: {
      //     formatter: "{value} ",
      //       },
      axisTick: {
        alignWithLabel: true,
      },
      axisLine: {
        //坐标轴轴线相关设置。数学上的x轴
        show: false,
        lineStyle: {
          color: "#fff",
        },
      },
      axisLabel: {
        show: true,
        //坐标轴刻度标签的相关设置
        textStyle: {
          color: "rgba(118, 118, 169, 1)",
          fontSize: 12,
        },
        interval: 0,
        formatter: function (params) {
          return params;
        },
      },
      splitLine: {
        show: true,
        lineStyle: {
          color: "#0b4f75",
          type: "dashed", // 线型为虚线
        },
      },
      axisTick: {
        show: false,
      },
    },
    series: [
      {
        name: "前半个小时当日访问量(次)",
        type: "line",
        tooltip: {
          valueFormatter: function (value) {
            return value;
          },
        },
        data: hourValueList,
        itemStyle: {
          borderRadius: [10, 10, 0, 0], // 这里设置圆角的大小
          color: "#6BFF86",
        },
        // show: false,
      },
      {
        name: "当日访问量(次)",
        type: "line",
        tooltip: {
          valueFormatter: function (value) {
            return value;
          },
        },
        data: todayValueList,
        itemStyle: {
          borderRadius: [10, 10, 0, 0], // 这里设置圆角的大小
          color: "#FF8D1A",
        },
        show: false,
      },

      {
        name: "总访问量(次)",
        type: "line",
        // yAxisIndex: 1,
        tooltip: {
          valueFormatter: function (value) {
            return value;
          },
        },
        data: totalValueList,
        itemStyle: {
          color: "#FC56BA",
        },
        show: false,
      },
    ],
    // series: [
    //   {
    //     data: [820, 932, 901, 934, 1290, 1330, 1320],
    //     type: "line",
    //     smooth: true,
    //   },
    // ],
  };
  let chartDom = document.getElementById("main_item1_z");
  let myChart = echarts.init(chartDom);
  myChart.setOption(option);
};

onMounted(() => {
  watchEffect(() => {
    console.log(props.item1T_num, "222222222211111111111");
    switch (props.item1T_num) {
      case 1:
        init();
        break;
      case 2:
        let aa3 = [
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "00:00:00",
            timeStr: "00:00",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "00:30:00",
            timeStr: "00:30",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "01:00:00",
            timeStr: "01:00",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "01:30:00",
            timeStr: "01:30",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "02:00:00",
            timeStr: "02:00",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "02:30:00",
            timeStr: "02:30",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "03:00:00",
            timeStr: "03:00",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "03:30:00",
            timeStr: "03:30",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "04:00:00",
            timeStr: "04:00",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "04:30:00",
            timeStr: "04:30",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "05:00:00",
            timeStr: "05:00",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "05:30:00",
            timeStr: "05:30",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "06:00:00",
            timeStr: "06:00",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "06:30:00",
            timeStr: "06:30",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "07:00:00",
            timeStr: "07:00",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "07:30:00",
            timeStr: "07:30",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "08:00:00",
            timeStr: "08:00",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "08:30:00",
            timeStr: "08:30",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "09:00:00",
            timeStr: "09:00",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "09:30:00",
            timeStr: "09:30",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "10:00:00",
            timeStr: "10:00",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "10:30:00",
            timeStr: "10:30",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "11:00:00",
            timeStr: "11:00",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "11:30:00",
            timeStr: "11:30",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "12:00:00",
            timeStr: "12:00",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "12:30:00",
            timeStr: "12:30",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "13:00:00",
            timeStr: "13:00",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "13:30:00",
            timeStr: "13:30",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "14:00:00",
            timeStr: "14:00",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "14:30:00",
            timeStr: "14:30",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "15:00:00",
            timeStr: "15:00",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "15:30:00",
            timeStr: "15:30",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "16:00:00",
            timeStr: "16:00",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "16:30:00",
            timeStr: "16:30",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "17:00:00",
            timeStr: "17:00",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "17:30:00",
            timeStr: "17:30",
          },
          {
            name: "晚上时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "18:00:00",
            timeStr: "18:00",
          },
          {
            name: "晚上时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "18:30:00",
            timeStr: "18:30",
          },
          {
            name: "晚上时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "19:00:00",
            timeStr: "19:00",
          },
          {
            name: "晚上时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "19:30:00",
            timeStr: "19:30",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "20:00:00",
            timeStr: "20:00",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "20:30:00",
            timeStr: "20:30",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "21:00:00",
            timeStr: "21:00",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "21:30:00",
            timeStr: "21:30",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "22:00:00",
            timeStr: "22:00",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "22:30:00",
            timeStr: "22:30",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "23:00:00",
            timeStr: "23:00",
          },
          {
            name: "晚上时段",
            todayValue: 0,
            totalValue: 9240,
            hourValue: 0,
            time: "23:30:00",
            timeStr: "23:30",
          },
        ];
        let hourValueList3 = [];
        let todayValueList3 = [];
        let totalValueList3 = [];
        aa3.forEach((v) => {
          hourValueList3.push(v.hourValue);
          todayValueList3.push(v.todayValue);
          totalValueList3.push(v.totalValue);
        });
        let option3 = {
          grid: {
            left: "4%",
            right: "18%",
            bottom: "20%",
            top: "10%",
            containLabel: true,
          },
          tooltip: {
            trigger: "axis",
            axisPointer: {
              type: "cross",
              crossStyle: {
                color: "#999",
              },
            },
          },
          legend: {
            data: [
              "前半个小时当日访问量(次)",
              "当日访问量(次)",
              "总访问量(次)",
            ],
            selectedMode: "single",
            itemWidth: 20,
            itemHeight: 14,
            right: "15%",
            textStyle: {
              //图例中文字的样式
              color: "#ffffff",
              fontSize: 11,
            },
          },
          xAxis: [
            {
              type: "category",
              data: [
                "0:00",
                "0:30",
                "1:00",
                "1:30",
                "2:00",
                "2:30",
                "3:00",
                "3:30",
                "4:00",
                "4:30",
                "5:00",
                "5:30",
                "6:00",
                "6:30",
                "7:00",
                "7:30",
                "8:00",
                "8:30",
                "9:00",
                "9:30",
                "10:00",
                "10:30",
                "11:00",
                "11:30",
                "12:00",
                "12:30",
                "13:00",
                "13:30",
                "14:00",
                "14:30",
                "15:00",
                "15:30",
                "16:00",
                "16:30",
                "17:00",
                "17:30",
                "18:00",
                "18:30",
                "19:00",
                "19:30",
                "20:00",
                "20:30",
                "21:00",
                "21:30",
                "22:00",
                "22:30",
                "23:00",
                "23:30",
              ],
              axisPointer: {
                type: "shadow",
              },
              axisLabel: {
                // rotate: -35, // 轴标签倾斜 35 度
                color: "#8cb6dd",
                fontSize: 10,
              },
            },
          ],
          yAxis: [
            {
              type: "value",
              name: "单位:次",
              // min: 0,
              // max: 11000,
              // interval: 1000,
              axisLabel: {
                formatter: "{value} ",
                color: "#8cb6dd", // 这里设置字体颜色为红色
                fontSize: 12,
              },

              axisLine: {
                show: true, // 是否显示轴线
                lineStyle: {
                  color: "#8cb6dd", // 设置轴线颜色为红色
                },
              },
            },

            {
              type: "value",
              name: "Temperature",
              // min: 0,
              // max: 11000,
              // interval: 1000,
              axisLabel: {
                formatter: "{value}",
              },
              show: false,
            },
          ],
          series: [
            {
              name: "前半个小时当日访问量(次)",
              type: "line",
              tooltip: {
                valueFormatter: function (value) {
                  return value;
                },
              },
              data: hourValueList3,
              itemStyle: {
                borderRadius: [10, 10, 0, 0], // 这里设置圆角的大小
                color: "#6BFF86",
              },
              // show: false,
            },

            {
              name: "当日访问量(次)",
              type: "line",
              tooltip: {
                valueFormatter: function (value) {
                  return value;
                },
              },
              data: todayValueList3,
              itemStyle: {
                borderRadius: [10, 10, 0, 0], // 这里设置圆角的大小
                color: "#FF8D1A",
              },
              show: false,
            },

            {
              name: "总访问量(次)",
              type: "line",
              // yAxisIndex: 1,
              tooltip: {
                valueFormatter: function (value) {
                  return value;
                },
              },
              data: totalValueList3,
              itemStyle: {
                color: "#FC56BA",
              },
              show: false,
            },
          ],
        };
        let chartDom3 = document.getElementById("main_item1_z");
        let myChart3 = echarts.init(chartDom3);
        myChart3.setOption(option3);
        break;
      case 3:
        let aa2 = [
          {
            name: "凌晨时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "00:00:00",
            timeStr: "00:00",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "00:30:00",
            timeStr: "00:30",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "01:00:00",
            timeStr: "01:00",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "01:30:00",
            timeStr: "01:30",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "02:00:00",
            timeStr: "02:00",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "02:30:00",
            timeStr: "02:30",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "03:00:00",
            timeStr: "03:00",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "03:30:00",
            timeStr: "03:30",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "04:00:00",
            timeStr: "04:00",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "04:30:00",
            timeStr: "04:30",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "05:00:00",
            timeStr: "05:00",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "05:30:00",
            timeStr: "05:30",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "06:00:00",
            timeStr: "06:00",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "06:30:00",
            timeStr: "06:30",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "07:00:00",
            timeStr: "07:00",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "07:30:00",
            timeStr: "07:30",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "08:00:00",
            timeStr: "08:00",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "08:30:00",
            timeStr: "08:30",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "09:00:00",
            timeStr: "09:00",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "09:30:00",
            timeStr: "09:30",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "10:00:00",
            timeStr: "10:00",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "10:30:00",
            timeStr: "10:30",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "11:00:00",
            timeStr: "11:00",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "11:30:00",
            timeStr: "11:30",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "12:00:00",
            timeStr: "12:00",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "12:30:00",
            timeStr: "12:30",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "13:00:00",
            timeStr: "13:00",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "13:30:00",
            timeStr: "13:30",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "14:00:00",
            timeStr: "14:00",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "14:30:00",
            timeStr: "14:30",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "15:00:00",
            timeStr: "15:00",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "15:30:00",
            timeStr: "15:30",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "16:00:00",
            timeStr: "16:00",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "16:30:00",
            timeStr: "16:30",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "17:00:00",
            timeStr: "17:00",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "17:30:00",
            timeStr: "17:30",
          },
          {
            name: "晚上时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "18:00:00",
            timeStr: "18:00",
          },
          {
            name: "晚上时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "18:30:00",
            timeStr: "18:30",
          },
          {
            name: "晚上时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "19:00:00",
            timeStr: "19:00",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "19:30:00",
            timeStr: "19:30",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "20:00:00",
            timeStr: "20:00",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "20:30:00",
            timeStr: "20:30",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "21:00:00",
            timeStr: "21:00",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "21:30:00",
            timeStr: "21:30",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "22:00:00",
            timeStr: "22:00",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "22:30:00",
            timeStr: "22:30",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "23:00:00",
            timeStr: "23:00",
          },
          {
            name: "晚上时段",
            type: null,
            todayValue: 318614,
            timeValue: 700.12,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "23:30:00",
            timeStr: "23:30",
          },
        ];
        let hourTimeValueList2 = [];
        let hourValueList2 = [];
        let todayValueList2 = [];
        let timeValueList2 = [];
        aa2.forEach((v) => {
          hourTimeValueList2.push(v.hourTimeValue);
          hourValueList2.push(v.hourValue);
          todayValueList2.push(v.todayValue);
          timeValueList2.push(v.timeValue);
        });
        let option2 = {
          grid: {
            left: "4%",
            right: "18%",
            bottom: "20%",
            top: "10%",
            containLabel: true,
          },
          tooltip: {
            trigger: "axis",
            axisPointer: {
              type: "cross",
              crossStyle: {
                color: "#999",
              },
            },
          },
          legend: {
            data: [
              "前半个小时接口调用总数量(次)",
              "前半个小时当日平均请求时间(ms)",
              "当日接口调用总数(次)",
              "当日平均请求时间(ms)",
            ],
            selectedMode: "single",
            itemWidth: 20,
            itemHeight: 14,
            right: "0%",
            textStyle: {
              //图例中文字的样式
              color: "#ffffff",
              fontSize: 11,
            },
          },
          xAxis: [
            {
              type: "category",
              data: [
                "0:00",
                "0:30",
                "1:00",
                "1:30",
                "2:00",
                "2:30",
                "3:00",
                "3:30",
                "4:00",
                "4:30",
                "5:00",
                "5:30",
                "6:00",
                "6:30",
                "7:00",
                "7:30",
                "8:00",
                "8:30",
                "9:00",
                "9:30",
                "10:00",
                "10:30",
                "11:00",
                "11:30",
                "12:00",
                "12:30",
                "13:00",
                "13:30",
                "14:00",
                "14:30",
                "15:00",
                "15:30",
                "16:00",
                "16:30",
                "17:00",
                "17:30",
                "18:00",
                "18:30",
                "19:00",
                "19:30",
                "20:00",
                "20:30",
                "21:00",
                "21:30",
                "22:00",
                "22:30",
                "23:00",
                "23:30",
              ],
              axisPointer: {
                type: "shadow",
              },
              axisLabel: {
                // rotate: -35, // 轴标签倾斜 35 度
                color: "#8cb6dd",
                fontSize: 10,
              },
            },
          ],
          yAxis: [
            {
              type: "value",
              // name: '单位:次',
              // min: 0,
              // max: 11000,
              // interval: 1000,
              axisLabel: {
                formatter: "{value} ",
                color: "#8cb6dd", // 这里设置字体颜色为红色
                fontSize: 12,
              },

              axisLine: {
                show: true, // 是否显示轴线
                lineStyle: {
                  color: "#8cb6dd", // 设置轴线颜色为红色
                },
              },
            },

            {
              type: "value",
              name: "Temperature",
              // min: 0,
              // max: 11000,
              // interval: 1000,
              axisLabel: {
                formatter: "{value}",
              },
              show: false,
            },
          ],
          series: [
            {
              name: "前半个小时接口调用总数量(次)",
              type: "line",
              tooltip: {
                valueFormatter: function (value) {
                  return value + "次";
                },
              },
              data: todayValueList2,
              itemStyle: {
                borderRadius: [10, 10, 0, 0], // 这里设置圆角的大小
                color: "#6BFF86",
              },
              // show: false,
            },

            {
              name: "前半个小时当日平均请求时间(ms)",
              type: "line",
              tooltip: {
                valueFormatter: function (value) {
                  return value + "ms";
                },
              },
              data: timeValueList2,
              itemStyle: {
                borderRadius: [10, 10, 0, 0], // 这里设置圆角的大小
                color: "#FF8D1A",
              },
              show: false,
            },

            {
              name: "当日接口调用总数(次)",
              type: "line",
              // yAxisIndex: 1,
              tooltip: {
                valueFormatter: function (value) {
                  return value + "次";
                },
              },
              data: todayValueList2,
              itemStyle: {
                color: "#FC56BA",
              },
              show: false,
            },

            {
              name: "当日平均请求时间(ms)",
              type: "line",
              // yAxisIndex: 1,
              tooltip: {
                valueFormatter: function (value) {
                  return value + "ms";
                },
              },
              data: timeValueList2,
              itemStyle: {
                color: "#FFF461",
              },
              show: false,
            },
          ],
        };
        let chartDom2 = document.getElementById("main_item1_z");
        let myChart2 = echarts.init(chartDom2);
        myChart2.setOption(option2);
        break;
      case 4:
        init();
        break;
      case 5:
        let aa1 = [
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "00:00:00",
            timeStr: "00:00",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "00:30:00",
            timeStr: "00:30",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "01:00:00",
            timeStr: "01:00",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "01:30:00",
            timeStr: "01:30",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "02:00:00",
            timeStr: "02:00",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "02:30:00",
            timeStr: "02:30",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "03:00:00",
            timeStr: "03:00",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "03:30:00",
            timeStr: "03:30",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "04:00:00",
            timeStr: "04:00",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "04:30:00",
            timeStr: "04:30",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "05:00:00",
            timeStr: "05:00",
          },
          {
            name: "凌晨时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "05:30:00",
            timeStr: "05:30",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "06:00:00",
            timeStr: "06:00",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "06:30:00",
            timeStr: "06:30",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "07:00:00",
            timeStr: "07:00",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "07:30:00",
            timeStr: "07:30",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "08:00:00",
            timeStr: "08:00",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "08:30:00",
            timeStr: "08:30",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "09:00:00",
            timeStr: "09:00",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "09:30:00",
            timeStr: "09:30",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "10:00:00",
            timeStr: "10:00",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "10:30:00",
            timeStr: "10:30",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "11:00:00",
            timeStr: "11:00",
          },
          {
            name: "上午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "11:30:00",
            timeStr: "11:30",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "12:00:00",
            timeStr: "12:00",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "12:30:00",
            timeStr: "12:30",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "13:00:00",
            timeStr: "13:00",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "13:30:00",
            timeStr: "13:30",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "14:00:00",
            timeStr: "14:00",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "14:30:00",
            timeStr: "14:30",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "15:00:00",
            timeStr: "15:00",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "15:30:00",
            timeStr: "15:30",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "16:00:00",
            timeStr: "16:00",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "16:30:00",
            timeStr: "16:30",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "17:00:00",
            timeStr: "17:00",
          },
          {
            name: "下午时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "17:30:00",
            timeStr: "17:30",
          },
          {
            name: "晚上时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "18:00:00",
            timeStr: "18:00",
          },
          {
            name: "晚上时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "18:30:00",
            timeStr: "18:30",
          },
          {
            name: "晚上时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "19:00:00",
            timeStr: "19:00",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "19:30:00",
            timeStr: "19:30",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "20:00:00",
            timeStr: "20:00",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "20:30:00",
            timeStr: "20:30",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "21:00:00",
            timeStr: "21:00",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "21:30:00",
            timeStr: "21:30",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "22:00:00",
            timeStr: "22:00",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "22:30:00",
            timeStr: "22:30",
          },
          {
            name: null,
            todayValue: 0,
            totalValue: 0,
            hourValue: 0,
            time: "23:00:00",
            timeStr: "23:00",
          },
          {
            name: "晚上时段",
            todayValue: 0,
            totalValue: 456306,
            hourValue: 0,
            time: "23:30:00",
            timeStr: "23:30",
          },
        ];
        let hourValueList1 = [];
        let todayValueList1 = [];
        let totalValueList1 = [];
        aa1.forEach((v) => {
          hourValueList1.push(v.hourValue);
          todayValueList1.push(v.todayValue);
          totalValueList1.push(v.totalValue);
        });
        let option1 = {
          grid: {
            left: "4%",
            right: "18%",
            bottom: "20%",
            top: "10%",
            containLabel: true,
          },
          tooltip: {
            trigger: "axis",
            axisPointer: {
              type: "cross",
              crossStyle: {
                color: "#999",
              },
            },
          },
          legend: {
            data: [
              "前半个小时当日访问量(次)",
              "当日访问量(次)",
              "总访问量(次)",
            ],
            selectedMode: "single",
            itemWidth: 20,
            itemHeight: 14,
            right: "0%",
            textStyle: {
              //图例中文字的样式
              color: "#ffffff",
              fontSize: 11,
            },
          },
          xAxis: [
            {
              type: "category",
              data: [
                "0:00",
                "0:30",
                "1:00",
                "1:30",
                "2:00",
                "2:30",
                "3:00",
                "3:30",
                "4:00",
                "4:30",
                "5:00",
                "5:30",
                "6:00",
                "6:30",
                "7:00",
                "7:30",
                "8:00",
                "8:30",
                "9:00",
                "9:30",
                "10:00",
                "10:30",
                "11:00",
                "11:30",
                "12:00",
                "12:30",
                "13:00",
                "13:30",
                "14:00",
                "14:30",
                "15:00",
                "15:30",
                "16:00",
                "16:30",
                "17:00",
                "17:30",
                "18:00",
                "18:30",
                "19:00",
                "19:30",
                "20:00",
                "20:30",
                "21:00",
                "21:30",
                "22:00",
                "22:30",
                "23:00",
                "23:30",
              ],
              axisPointer: {
                type: "shadow",
              },
              axisLabel: {
                // rotate: -35, // 轴标签倾斜 35 度
                color: "#8cb6dd",
                fontSize: 10,
              },
            },
          ],
          yAxis: [
            {
              type: "value",
              name: "单位:次",
              axisLabel: {
                formatter: "{value} ",
                color: "#8cb6dd", // 这里设置字体颜色为红色
                fontSize: 12,
              },

              axisLine: {
                show: true, // 是否显示轴线
                lineStyle: {
                  color: "#8cb6dd", // 设置轴线颜色为红色
                },
              },
            },

            {
              type: "value",
              name: "Temperature",
              axisLabel: {
                formatter: "{value}",
              },
              show: false,
            },
          ],
          series: [
            {
              name: "前半个小时当日访问量(次)",
              type: "line",
              tooltip: {
                valueFormatter: function (value) {
                  return value;
                },
              },
              data: hourValueList1,
              itemStyle: {
                borderRadius: [10, 10, 0, 0], // 这里设置圆角的大小
                color: "#6BFF86",
              },
              // show: false,
            },

            {
              name: "当日访问量(次)",
              type: "line",
              tooltip: {
                valueFormatter: function (value) {
                  return value;
                },
              },
              data: todayValueList1,
              itemStyle: {
                borderRadius: [10, 10, 0, 0], // 这里设置圆角的大小
                color: "#FF8D1A",
              },
              show: false,
            },

            {
              name: "总访问量(次)",
              type: "line",
              // yAxisIndex: 1,
              tooltip: {
                valueFormatter: function (value) {
                  return value;
                },
              },
              data: totalValueList1,
              itemStyle: {
                color: "#FC56BA",
              },
              show: false,
            },
          ],
        };
        let chartDom1 = document.getElementById("main_item1_z");
        let myChart1 = echarts.init(chartDom1);
        myChart1.setOption(option1);
        break;
      case 6:
        let aa = [
          {
            name: "凌晨时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "00:00:00",
            timeStr: "00:00",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "00:30:00",
            timeStr: "00:30",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "01:00:00",
            timeStr: "01:00",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "01:30:00",
            timeStr: "01:30",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "02:00:00",
            timeStr: "02:00",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "02:30:00",
            timeStr: "02:30",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "03:00:00",
            timeStr: "03:00",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "03:30:00",
            timeStr: "03:30",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "04:00:00",
            timeStr: "04:00",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "04:30:00",
            timeStr: "04:30",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "05:00:00",
            timeStr: "05:00",
          },
          {
            name: "凌晨时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "05:30:00",
            timeStr: "05:30",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "06:00:00",
            timeStr: "06:00",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "06:30:00",
            timeStr: "06:30",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "07:00:00",
            timeStr: "07:00",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "07:30:00",
            timeStr: "07:30",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "08:00:00",
            timeStr: "08:00",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "08:30:00",
            timeStr: "08:30",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "09:00:00",
            timeStr: "09:00",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "09:30:00",
            timeStr: "09:30",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "10:00:00",
            timeStr: "10:00",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "10:30:00",
            timeStr: "10:30",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "11:00:00",
            timeStr: "11:00",
          },
          {
            name: "上午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "11:30:00",
            timeStr: "11:30",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "12:00:00",
            timeStr: "12:00",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "12:30:00",
            timeStr: "12:30",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "13:00:00",
            timeStr: "13:00",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "13:30:00",
            timeStr: "13:30",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "14:00:00",
            timeStr: "14:00",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "14:30:00",
            timeStr: "14:30",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "15:00:00",
            timeStr: "15:00",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "15:30:00",
            timeStr: "15:30",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "16:00:00",
            timeStr: "16:00",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "16:30:00",
            timeStr: "16:30",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "17:00:00",
            timeStr: "17:00",
          },
          {
            name: "下午时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "17:30:00",
            timeStr: "17:30",
          },
          {
            name: "晚上时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "18:00:00",
            timeStr: "18:00",
          },
          {
            name: "晚上时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "18:30:00",
            timeStr: "18:30",
          },
          {
            name: "晚上时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "19:00:00",
            timeStr: "19:00",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "19:30:00",
            timeStr: "19:30",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "20:00:00",
            timeStr: "20:00",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "20:30:00",
            timeStr: "20:30",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "21:00:00",
            timeStr: "21:00",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "21:30:00",
            timeStr: "21:30",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "22:00:00",
            timeStr: "22:00",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "22:30:00",
            timeStr: "22:30",
          },
          {
            name: null,
            type: null,
            todayValue: 0,
            timeValue: 0,
            hourTimeValue: 0,
            hourValue: 0,
            time: "23:00:00",
            timeStr: "23:00",
          },
          {
            name: "晚上时段",
            type: null,
            todayValue: 215700,
            timeValue: 439.28,
            hourTimeValue: 0.0,
            hourValue: 0,
            time: "23:30:00",
            timeStr: "23:30",
          },
        ];
        let hourTimeValueList = [];
        let hourValueList = [];
        let todayValueList = [];
        let timeValueList = [];
        aa.forEach((v) => {
          hourTimeValueList.push(v.hourTimeValue);
          hourValueList.push(v.hourValue);
          todayValueList.push(v.todayValue);
          timeValueList.push(v.timeValue);
        });
        let option = {
          grid: {
            left: "4%",
            right: "18%",
            bottom: "20%",
            top: "10%",
            containLabel: true,
          },
          tooltip: {
            trigger: "axis",
            axisPointer: {
              type: "cross",
              crossStyle: {
                color: "#999",
              },
            },
          },
          legend: {
            data: [
              "前半个小时接口调用总数量(次)",
              "前半个小时当日平均请求时间(ms)",
              "当日接口调用总数(次)",
              "当日平均请求时间(ms)",
            ],
            selectedMode: "single",
            itemWidth: 20,
            itemHeight: 14,
            right: "0%",
            textStyle: {
              //图例中文字的样式
              color: "#ffffff",
              fontSize: 11,
            },
          },
          xAxis: [
            {
              type: "category",
              data: [
                "0:00",
                "0:30",
                "1:00",
                "1:30",
                "2:00",
                "2:30",
                "3:00",
                "3:30",
                "4:00",
                "4:30",
                "5:00",
                "5:30",
                "6:00",
                "6:30",
                "7:00",
                "7:30",
                "8:00",
                "8:30",
                "9:00",
                "9:30",
                "10:00",
                "10:30",
                "11:00",
                "11:30",
                "12:00",
                "12:30",
                "13:00",
                "13:30",
                "14:00",
                "14:30",
                "15:00",
                "15:30",
                "16:00",
                "16:30",
                "17:00",
                "17:30",
                "18:00",
                "18:30",
                "19:00",
                "19:30",
                "20:00",
                "20:30",
                "21:00",
                "21:30",
                "22:00",
                "22:30",
                "23:00",
                "23:30",
              ],
              axisPointer: {
                type: "shadow",
              },
              axisLabel: {
                // rotate: -35, // 轴标签倾斜 35 度
                color: "#8cb6dd",
                fontSize: 10,
              },
            },
          ],
          yAxis: [
            {
              type: "value",
              // name: '单位:次',
              // min: 0,
              // max: 11000,
              // interval: 1000,
              axisLabel: {
                formatter: "{value} ",
                color: "#8cb6dd", // 这里设置字体颜色为红色
                fontSize: 12,
              },

              axisLine: {
                show: true, // 是否显示轴线
                lineStyle: {
                  color: "#8cb6dd", // 设置轴线颜色为红色
                },
              },
            },

            {
              type: "value",
              name: "Temperature",
              // min: 0,
              // max: 11000,
              // interval: 1000,
              axisLabel: {
                formatter: "{value}",
              },
              show: false,
            },
          ],
          series: [
            {
              name: "前半个小时接口调用总数量(次)",
              type: "line",
              tooltip: {
                valueFormatter: function (value) {
                  return value + "次";
                },
              },
              data: todayValueList,
              itemStyle: {
                borderRadius: [10, 10, 0, 0], // 这里设置圆角的大小
                color: "#6BFF86",
              },
              // show: false,
            },

            {
              name: "前半个小时当日平均请求时间(ms)",
              type: "line",
              tooltip: {
                valueFormatter: function (value) {
                  return value + "ms";
                },
              },
              data: timeValueList,
              itemStyle: {
                borderRadius: [10, 10, 0, 0], // 这里设置圆角的大小
                color: "#FF8D1A",
              },
              show: false,
            },

            {
              name: "当日接口调用总数(次)",
              type: "line",
              // yAxisIndex: 1,
              tooltip: {
                valueFormatter: function (value) {
                  return value + "次";
                },
              },
              data: todayValueList,
              itemStyle: {
                color: "#FC56BA",
              },
              show: false,
            },

            {
              name: "当日平均请求时间(ms)",
              type: "line",
              // yAxisIndex: 1,
              tooltip: {
                valueFormatter: function (value) {
                  return value + "ms";
                },
              },
              data: timeValueList,
              itemStyle: {
                color: "#FFF461",
              },
              show: false,
            },
          ],
        };
        let chartDom = document.getElementById("main_item1_z");
        let myChart = echarts.init(chartDom);
        myChart.setOption(option);
        break;
      default:
        break;
    }
  });
  sat().then((res) => {
    console.log(res, "ywppppppppppp");

    // res.data.clickStat.forEach((v) => {});
    // showData.value.hourValueList = hourValueList;
    // showData.value.todayValueList = todayValueList;
    // showData.value.totalValueList = totalValueList;
  });
});

const emits = defineEmits(["close"]);
</script>

<template>
  <div id="main_item1_z" class="main_item1_z"></div>
</template>

<style lang="less" scoped>
.main_item1_z {
  width: 1271px;
  height: 670px;
}
.size16 {
  font-size: 1rem;
}
.size20 {
  font-size: 1.25rem;
}

.color12 {
  color: #71f1ea;
}
.color13 {
  color: #c9e9f8;
}
.color14 {
  color: #ffffff;
}

.font_family_num {
  font-family: Helvetica-Bold !important;
  font-weight: bold;
}
</style>
